<?php
namespace app\wechat\controller;
use think\Controller;
use think\Request;
use \think\Db;
class Index extends Controller
{

	
    public function index()
    {
        return $this->fetch();     
    }
    public function addLinkMan()
    {
        
        $params = Request::instance()->param();
        //link_data
            $linkData['phone_number']=$params['userPhone'];
            $linkData['link_man_name']=$params['userName'];
            $linkData['wechat_number']=$params['userWechat'];
            $linkData['id_number']=$params['userIdNumber'];
            $linkData['sex']=$params['userGender'];
            $linkData['apply_for_job']=$params['userJob'];
        $linkData['create_time']=time();
       $linkManId=Db::table('link_man')->insertGetId($linkData);
        
    
        
//        if (Request::instance()->isAjax())
//            echo "当前为 Ajax 请求";

//          if ($request->isAjax()) {
//      
        $graduation_time=strtotime($params['userGraduationTime']);
               
        $eduData['link_man_id']=$linkManId;
        $eduData['school_name']=$params['userSchool'];
        $eduData['school_major']=$params['userMajor'];
        $eduData['graduation_year_month']=$graduation_time;
        $eduData['education_level']=$params['userEducation'];
           
                 if($graduation_time < time()){
                     $graduation_status='1';
                 }else{
                     $graduation_status='2';
                 }
//
                 $eduData['graduation_status']=$graduation_status;
//
           Db::table('education')->insertGetId($eduData);
//                  $res='1';
//                  return $res;

//        }
//        $userData['value']=$params['testNum'];
//        Db::table('think_test')->insertGetId($userData);
        $res='1';
        return $res;

    
        
        
    }
    public function res_success()
    {
        
        return $this->fetch();
        
        
    }
  
}
